﻿<UserControl
    x:Class="Markup.Programming.Samples.DynamicButton"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:p="http://markupprogramming.codeplex.com/markup/programming"
    Height="300" Width="300">
    <Grid>
        <StackPanel Name="ContentHost">
            <Button Content="Add">
                <p:Attached.Operations>
                    <p:CallHandler Context="{Binding ElementName=ContentHost}">
                        <p:CallHandler.Path>
                            Click => Children.Add([Button] { Content = "Click Me!", Opacity = 0.5 })
                        </p:CallHandler.Path>
                    </p:CallHandler>
                </p:Attached.Operations>
            </Button>
        </StackPanel>
    </Grid>
</UserControl>
